<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

//
include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'module/content/content.class.php');

class BlogContentBase extends ContentBase {
	//type
	var $_type = 3;
	
	//constructor
	function BlogContentBase() {
		parent::ContentBase();
	}
	
	//setter/getter
	function setType($type = 0) {
		if( $type > 0 ) {
			$this->_type = $type;
		}
	}
	
	//methods
	function onAddItemFilterBind($data_array) {
		$fb = array();
		if( $this->_type > 0 ) {
			$fb['_type'] = (int)$this->_type;
		}
		
		return $fb;
	}
	
	function onUpdateItemFilterBind($items_id, $data_array) {
		$fb = array();
		if( $this->_type > 0 ) {
			$fb['_type'] = (int)$this->_type;
		}
		
		return $fb;
	}
	
	//private
	function _get_query_str_custom() {
		$query_str = "";
		if( $this->_type > 0 ) {
			$query_str .= " and " . $this->_pf('type') . " = '" . (int)$this->_type . "'";
		}
		
		return $query_str;
	}
}
//
?>